import './Workflow.scss';
import * as React from 'react';
import { connect } from 'react-redux';

import WorkflowToolBar from './WorkflowToolBar';
import WorkflowContent from './WorkflowContent';
import WorkflowProps from './WorkflowProps';
import WorkflowFlaotNode from './WorkflowFlaotNode';

import { IWorkflowFlaotNodeProps } from './WorkflowFlaotNode';

interface IProps {
    /** 操作模式 */
    operaType: number;
    /** 新增节点数据 */
    nodeData: IWorkflowFlaotNodeProps;
}

class Workflow extends React.Component<IProps, any> {
    render() {
        return (
            <div className='workflow-container'>
                <WorkflowToolBar />
                <WorkflowContent />
                <WorkflowProps />
                <WorkflowFlaotNode />
            </div>
        );
    }
};


const mapStateToProps = (state: any) => {
    const { operaType, nodeData } = state.action;
    return {
        operaType,
        nodeData
    };
};

export default connect(mapStateToProps)(Workflow);
